package com.lightsh.joint;

import org.jbox2d.dynamics.World;
import org.jbox2d.dynamics.joints.Joint;
import org.jbox2d.dynamics.joints.JointDef;

import com.lightsh.interfaces.creator.IBodyCreator;

public abstract class BaseJoint implements IBodyCreator{
	protected JointDef mJointDef; 
	protected World mWorld;
	protected Joint mJoint;

	@Override
	public void create(){
		if(mJoint != null){
			throw new RuntimeException("joint had been created!");
		}
		mJoint = mWorld.createJoint(mJointDef);
	}
	
	public Joint getJoint(){
		return mJoint;
	}
}
